package kr.hkit.powerjava.chapter21;

import java.util.InputMismatchException;
import java.util.Scanner;

public class DivideByZero {
	public static void main(String[] args) {
		int x = 0;
		int y = 0;
		Scanner input = new Scanner(System.in);
		
		int result = 0;
		
		try{
			System.out.print("피젯수 : ");
			x = input.nextInt();
			System.out.print("젯수 : ");
			y = input.nextInt();
		} catch(InputMismatchException e){
			System.out.println("숫자만 가능");
		}
		
		try{
			result = x / y;
		} catch(ArithmeticException e){
			System.out.println("0으로 나눌 수 없음");
		} catch(Exception e){
			System.out.println("aaaa");
		} finally{
			System.out.println("나눗셈 결과 : " + result);
		}
	}
}
